<div class="container">
  <ol class="breadcrumb">
    <li><%= link_to 'Home', root_path %></li>
    <li class="active">Mobile Notification</li>
  </ol>
</div>

<div class="container">
  <h1>
    All registered mobile notifications
    <a href="<%= new_mobile_notification_path %>" class="btn btn-success"> <span class="glyphicon glyphicon-upload"></span> Register a
      new mobile notification</a>
  </h1>

  <div class="media">
    <% if @mobile_notifications.empty? %>
      <div class="alert alert-warning">
        No mobile notification is registered with the system.
      </div>
    <% else %>
      <table class="table table-hover">
        <thead>
          <tr>
            <th>#</th>
            <th>Application Name</th>
            <th>Analytic ID</th>
          </tr>
        </thead>
        <tbody>
          <% i = 1 %>
          <% @mobile_notifications.each do |mobile_notification| %>
            <% google_project = GoogleProject.find_by_id(mobile_notification.google_project_id) %>
            <tr>
              <td><%= i %></td>
              <td><%= google_project.application_name %></td>
              <td><%= mobile_notification.analytic_id %></td>
              <<td><%= link_to 'Delete', mobile_notification, method: :delete, :class => "btn btn-xs btn-danger", data: {confirm: 'Are you sure?'} %></td>
            </tr>
        <% end %>
        </tbody>
      </table>
    <% end %>
  </div>

  <br/>
</div>
